<template>
  <div class="item" @click="linkDetail">
    <div class="flex flex-1">
      <user-avater :avater="content.userUrl" :userName="content.userName" />
      <div class="content flex-1">
        <div class="name">{{ content.userName }}</div>
        <div class="copy">隶属单位：{{ content.orgName }}</div>
        <div class="time">{{ content.period }}</div>
      </div>
    </div>
    <div class="status-wrapper">
      <div class="status" v-if="content.judgeLevel">{{ levelList[content.judgeLevel] }}</div>
      <div class="text">评定等级</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    content: {
      type: Object,
      default: () => {}
    },
    levelList: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    linkDetail() {
      sessionStorage.setItem("objectUser", JSON.stringify(this.content));
      this.$router.push({
        path: "/objectionHandle/detail",
        query: {
          id: this.content.id,
          is_year: this.$route.query.type == "year" ? 1 : 0
        }
      });
    }
  }
};
</script>

<style scoped lang="scss">
.item {
  display: flex;
  align-items: center;
  background: #fff;
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 16px 20px;

  .flex-1 {
    flex: 1;
  }
  .name {
    color: #333;
    font-size: 14px;
    line-height: 20px;
  }
  .copy,
  .time {
    color: #a3a7ad;
    font-size: 12px;
    margin-top: 6px;
    line-height: 17px;
  }
  .status-wrapper {
    margin-left: 12px;
    text-align: right;
    .status {
      color: #f60e36;
      font-size: 15px;
      line-height: 21px;
      margin-bottom: 5px;
      font-weight: 600;
    }
    .text {
      line-height: 17px;
      color: #a3a7ad;
      font-size: 12px;
    }
  }
}
</style>
